package com.fg.cloud.manager.service.agency;

import java.util.List;

import com.fg.cloud.common.PageUtils;
import com.fg.cloud.manager.entry.agency.AgencyAddressEntity;
import com.fg.cloud.manager.entry.agency.vo.AgencyAddressVo;
import com.fg.cloud.manager.entry.agency.vo.AgencyUserVo;
import com.fg.cloud.manager.service.BaseService;

/**
 * 经销商-地址service
 * @author around
 * @date 2017-6-22
 */
public interface AgencyAddressService extends BaseService {
	

	/**
	 * Description:查询指定经销商地址
	 * @param id
	 * @return
	 * @author around
	 * @date 2017年8月3日上午9:58:04
	 */
	AgencyAddressEntity find(Long id);
	
	boolean finds(Long id, Long ageId);
	
	AgencyAddressEntity findOne(Long id, Long ageId);
	
	/**
	 * 分页查询，动态传参绑定
	 * @param pageinfo PageUtils
	 */
	void findList(PageUtils<AgencyAddressEntity> pageinfo);
	
	List<AgencyAddressEntity> selectAll(Long ageId);

	/**
	 * 批量删除数据
	 * @param ids
	 * @return
	 */
	boolean deletes(Long userId, Long ageId, Long[] ids);
	
	boolean remove(Long ageId, Long[] ids);
	
	boolean cancels(Long userId, Long ageId, Long[] ids);
	
	boolean setdefault(Long userId, Long ageId, Long id);
	
	boolean judgeIsExit(AgencyAddressVo address);
	
	boolean JudgeIsExit(AgencyAddressVo address);
	
	AgencyAddressEntity selectBycondition(AgencyAddressEntity searchVo);
	
	public void selectforPage(PageUtils<AgencyAddressEntity> pageinfo);

	/**
	 * Description:动态修改
	 * @param address
	 * @return
	 * @author around
	 * @date 2017年8月25日上午9:52:54
	 */
	boolean updateByPrimaryKeySelective(AgencyAddressVo address);

	boolean insertSelective(AgencyAddressVo address);
	
	/**
	 * Description:新增保存
	 * @param address
	 * @param user
	 * @return
	 * @author dingjiang
	 * @date 2017年9月26日上午10:00:12
	 */
	boolean insertAdd(AgencyAddressVo address, AgencyUserVo user);
	
	/**
	 * Description:编辑保存
	 * @param address
	 * @param user
	 * @param findOne
	 * @return
	 * @author dingjiang
	 * @date 2017年9月26日上午10:00:24
	 */
	boolean saveAdd(AgencyAddressVo address, AgencyUserVo user, AgencyAddressEntity findOne);
	
	
	
	/**
	 * Description:校验
	 * @param id
	 * @param name
	 * @return
	 * @author around
	 * @date 2017年8月27日下午4:58:08
	 */
	boolean verifyUniquely(AgencyAddressVo address);
	
	/**
	 * Description:查询默认收货地址
	 * @param ageId
	 * @return
	 * @author dingjiang
	 * @date 2017年9月27日上午11:09:54
	 */
	AgencyAddressEntity selectDefault(Long ageId);
}
